package com.buddy.qreport.query.converter;

import com.buddy.qreport.query.result.ResultDataType;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;

@Configuration
public class ResultDataTypeConverter implements Converter<String, ResultDataType> {
    @Override
    public ResultDataType convert(String s) {

        switch (s){

            case "NUMBER":
                return ResultDataType.DECIMAL;
            case "TEXT":
                return ResultDataType.VARCHAR;
        }

        return null;
    }
}
